Skip to content

feat: support BlockRun account API billing - #4

Merged
VickyXAI merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:feat/account-api-key
Sep 5, 2026
Merged

feat: support BlockRun account API billing#4
VickyXAI merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:feat/account-api-key

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Collaborator

Franklin.bet's generator and CI previously required a Base x402 wallet, and the public docs/site said API keys were unsupported. This makes BLOCKRUN_API_KEY the preferred billing credential for chat generation, passes it through both automation workflows (including Franklin agent mode), preserves wallet fallback, and updates the site, README, env template, and contributor guidance with account registration, credits, and key links. Wallet documentation now lists Solana before Base where the Franklin agent supports both.

Depends on BlockRunAI/blockrun-llm-ts#36 and BlockRunAI/Franklin#156. Refresh the lockfile to the SDK release containing #36 before merge.

Validation:

  • npm test — 5/5 pass
  • Node syntax checks for generator, event CLI, and shared oracle
  • package/lock JSON parse and npm pack --dry-run
  • Live account API through this repository's resolveClient: openai/gpt-4.1-nano returned the expected result, selected account billing, created no wallet files, and exposed no credential in output
  • npm audit — 0 vulnerabilities

KillerQueen-Z and others added 2 commits September 4, 2026 12:28
…on startup

`scripts/lib/oracle.mjs:323` builds `new LLMClient({ apiKey: ... })`, but the
dependency pinned `@blockrun/llm@^3.13.6` with the lockfile at 3.13.6. That
release does not accept `apiKey` and demands a wallet instead, so the account
path threw before it did anything:

    3.13.6  -> THROWS: Private key required. Pass privateKey in options or
                       set BASE_CHAIN_WALLET_KEY environment variable.
    3.15.0  -> constructed OK, authMode = api-key

The suite did not catch this: 5 passed both before and after, because nothing
covers the account branch of `resolveClient`. The check above was run directly
against both versions rather than inferred.

3.15.0 is the release carrying blockrun-llm-ts#36, published today. Same fix
as franklin-canvas#2, which had the same pin and whose tests DID catch it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Je8JRrGK7mifyGbf8VjRM
@VickyXAI

VickyXAI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Pushed a dependency fix (76d1ec6) — the account path threw before doing anything.

scripts/lib/oracle.mjs:323 builds new LLMClient({ apiKey: process.env.BLOCKRUN_API_KEY, ... }), but the dependency pinned @blockrun/llm@^3.13.6 with the lockfile at 3.13.6, which does not accept apiKey. Run directly against both versions rather than inferred:

3.13.6  -> THROWS: Private key required. Pass privateKey in options or
                   set BASE_CHAIN_WALLET_KEY environment variable.
3.15.0  -> constructed OK, authMode = api-key

The suite did not catch this — 5 passed before and after, because nothing covers the account branch of resolveClient. Same pin and same bug as franklin-canvas#2, whose tests did catch it; the difference was coverage, not severity.

Pinned to ^3.15.0 (the release carrying blockrun-llm-ts#36, published today). If it is worth a test, the one-liner above is the assertion.

@VickyXAI
VickyXAI merged commit bb37e25 into BlockRunAI:main Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants